import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: yang
 * Date: 2022-05-07
 * Time: 14:33
 */
public class Main {
    public static int[] myCopyOf(int[] nums){
        if(nums == null){
            return null;
        }
        int[] ret = new int[nums.length];
        for (int i = 0; i < nums.length; i++) {
            ret[i] = nums[i];
        }
        return ret;
    }

    public static void main(String[] args) {
        int []arr = {1,2,3,4,5,6};
        int []ret = myCopyOf(arr);
        String str = Arrays.toString(arr);
        System.out.println(str);
    }
}
